package com.wedata.致远接口;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.wedata.HttpUtils;

public class 单位管理 {

    public static void main(String[] args) {
        System.out.println(orgAccounts());;
    }

    private static Long orgAccounts(){
        //accountId	是	单位ID
        //  "orgAccountId" : 670869647114347,
        JSONArray jsonArray = HttpUtils.getList(token.hostUrl + "/rest/orgAccounts?token="+token.getToken());
        //System.out.println(jsonArray);
        for(int i =0; i<jsonArray.size(); i++){
            JSONObject result = jsonArray.getJSONObject(i);
            System.out.println(result);
            if("company".equals(result.get("code"))){
                return result.getLong("id");
            }
        }
        ////"orgAccountId" : 670869647114347, "id" : 670869647114347,"name" : "健萌体育产业发展集团有限公司",
        return 0L;
    }


}
